<template>
  <div>
    <div class="headline_three main clearfix">
      <div
        class="headline_three_banxing"
        v-for="(item, index) in list"
        :key="index"
        @click="toRegisterGuide(item)"
      >
        <div class="banxing">
          <div class="imgs">
            <img v-lazy="item.img || require('@/assets/images/zxzwt.png')" alt />
          </div>
          <div>
            <div class="banxing_title">{{ item.title }}</div>
            <div class="grid_time">
              <span>
                <van-icon name="underway-o" />
                <i>{{ item.addtime }}</i>
              </span>
              <span>
                <van-icon name="eye-o" />
                <i>{{ item.view_num }}</i>
              </span>
            </div>
          </div>
        </div>
        <van-divider class="divider" />
      </div>
    </div>
    <div class="none" v-if="list.length < 1">
      <img :src="require('@/assets/images/quesheng-kong.png')" alt />
      <div>暂无收藏</div>
    </div>
  </div>
</template>

<script>
import moment from 'moment'
// import { Toast } from 'vant'
// import { parseFav } from '@/utils/status/user'
import { newsLists } from '@/api/mine/collect'
// import { favNews } from '@/api/discover/index'
export default {
  data() {
    return {
      queryParams: {
        page: 1,
        size: 10
      },
      list: []
    }
  },

  computed: {},

  mounted() {
    this.fetchList()
  },

  methods: {
    // 获取个人信息
    fetchList() {
      newsLists(this.queryParams).then(res => {
        this.list = res.data.list
        this.list.map(b => {
          b.addtime = moment(b.addtime * 1000).format('YYYY-MM-DD HH:mm:ss')
        })
      })
    },
    toRegisterGuide(row) {
      this.$router.push({ path: '/information-details', query: row })
    }
  }
}
</script>

<style lang="scss" scoped>
.headline_three {
  margin: 20px 15px 15px;
  // padding: 10px 10px 15px;
  .banxing {
    display: flex;
    .imgs {
      margin-right: 9px;
      img {
        width: 112px;
        height: 75px;
        border-radius: 5px;
        overflow: hidden;
      }
    }
  }
  .divider {
    height: 0.5px;
    margin: 5px 0px 15px;
  }
  .banxing_title {
    // height: 40px;
    font-size: 14px;
    color: #333333;
    line-height: 20px;
    @include textoverflow(2);
  }
  .grid_time {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    font-size: 12px;
    font-weight: 400;
    color: #999999;
    .van-icon {
      // vertical-align: middle;
      // margin-bottom: 2px;
      margin-right: 5px;
    }
  }
  .banxing_zhixun {
    font-size: 12px;
    font-weight: 500;
    color: #999999;
    line-height: 30px;
    span {
      font-size: 12px;
      font-weight: 500;
      color: #999999;
      line-height: 30px;
    }
  }
}
.headline_three_banxing:last-child .divider {
  display: none;
}
</style>
